import 'package:backend.core/core/domain/entities/api/google_play/api_google_play_transaction_revocation_reason.dart';
import 'package:backend.core/core/domain/entities/google_play/google_play_transaction_revocation_reason.dart';

abstract class CreateApiGooglePlayTransactionRevocationReasonFromInternalOne {
  ApiGooglePlayTransactionRevocationReason call({
    required GooglePlayTransactionRevocationReason reason,
  });
}

class CreateApiGooglePlayTransactionRevocationReasonFromInternalOneImpl
    implements CreateApiGooglePlayTransactionRevocationReasonFromInternalOne {
  const CreateApiGooglePlayTransactionRevocationReasonFromInternalOneImpl();

  @override
  ApiGooglePlayTransactionRevocationReason call({
    required GooglePlayTransactionRevocationReason reason,
  }) {
    switch (reason) {
      case GooglePlayTransactionRevocationReason.other:
        return ApiGooglePlayTransactionRevocationReason.other;
      case GooglePlayTransactionRevocationReason.remorse:
        return ApiGooglePlayTransactionRevocationReason.remorse;
      case GooglePlayTransactionRevocationReason.notReceivedPurchase:
        return ApiGooglePlayTransactionRevocationReason.notReceivedPurchase;
      case GooglePlayTransactionRevocationReason.defectivePurchase:
        return ApiGooglePlayTransactionRevocationReason.defectivePurchase;
      case GooglePlayTransactionRevocationReason.accidentalPurchase:
        return ApiGooglePlayTransactionRevocationReason.accidentalPurchase;
      case GooglePlayTransactionRevocationReason.fraud:
        return ApiGooglePlayTransactionRevocationReason.fraud;
      case GooglePlayTransactionRevocationReason.friendlyFraud:
        return ApiGooglePlayTransactionRevocationReason.friendlyFraud;
      case GooglePlayTransactionRevocationReason.chargeback:
        return ApiGooglePlayTransactionRevocationReason.chargeback;
    }
  }
}
